#include "connection.h"
#include <QtNetwork>
#include <QTcpSocket>

Connection::Connection (QObject * parent) : QTcpSocket (parent)
{
    connect(this, SIGNAL(connected()), this, SLOT(socketConnected()));
    connect(this, SIGNAL(readyRead()), this, SLOT(processReadyRead()));
    connect(this, SIGNAL(error(QAbstractSocket::SocketError)), this, SLOT(socketError(QAbstractSocket::SocketError)));
}

void Connection::socketConnected()
{
    emit connectionEstablished();
}

void Connection::processReadyRead()
{
}

void Connection::sendMessage ()
{
}

void Connection::openConnection (const QString &serverAddress)
{
}

void Connection::closeConnection (const QString &serverAddress)
{
}

void Connection::socketError (QAbstractSocket::SocketError error)
{
    emit connectionLost();
}
